package com.wzdigit.wms.basic.mapper.core.transfer;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wzdigit.framework.orm.mybatis.MyBatisRepository;
import com.wzdigit.wms.basic.client.response.transfer.TransferRawDtlResponse;
import com.wzdigit.wms.basic.domain.transfer.TransferDtl;
import com.wzdigit.wms.basic.client.response.asnHeader.TransferWareHouseDtlExt;
import com.wzdigit.wms.basic.client.response.transfer.TransferManageDtlResponse;
import com.wzdigit.wms.basic.client.response.transfer.TransferTaskDtlResponse;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;


/**
 * <p>
 * 调拨单明细 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2021-01-19
 */
@MyBatisRepository
public interface TransferDtlMapper extends BaseMapper<TransferDtl> {

	/**
	 * 获取调拨单的明细
	 * @param transferHeaderId
	 * @return
	 */
	List<TransferManageDtlResponse> getListTransferManageDtl(Integer transferHeaderId);
	
	/**
	 * 获取调拨任务的明细
	 * @param transferHeaderId
	 * @return
	 */
	List<TransferTaskDtlResponse> getListTransferTaskDtl(Integer transferHeaderId);
	
	/**
	 * 获取转仓单明细
	 * @param search
	 * @return
	 */
	List<TransferWareHouseDtlExt> getListDtlTable(@Param("transferHeaderId") Integer transferHeaderId);
	
	int updateStatusByTransferNoAndStatus(@Param("status") Integer status,
            @Param("transferNo") String transferNo, @Param("byOrStatus") Integer... byOrStatus);

    void updateLotNoAndAttr(TransferDtl transferDtl);

	/**
	 * 调拨单管理细列表BS
	 * @param transferHeaderId
	 * @return
	 */
	List<TransferRawDtlResponse> getListTransferRawDtl(Integer transferHeaderId);

	//更新明细状态关闭
	int updateDtl(@Param("headerId")  Integer headerId,@Param("status")  Integer status,
				  @Param("loginName")  String loginName,@Param("modfiyTime") Date modfiyTime);

}
